<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/12/12
 * Time: 18:12
 */

namespace app\modules\command;


class HelloCommand implements CommandInterface
{
    /**
     * @var Receiver
     */
    private $_output;

    /**
     * 每个具体的命令都来自于不同的接收者
     *
     * HelloCommand constructor.
     * @param Receiver $receiver
     */
    public function __construct(Receiver $receiver)
    {
        $this->_output = $receiver;
    }

    /**
     * className
     *
     * @date   2018/12/12
     * @author edmmss
     * @return mixed
     */
    public function execute()
    {
        // TODO: Implement execute() method.
        $this->_output->write('Hello World');
    }
}